<div class="form">

<?php
	$catalogmodel = Catalog::model()->findAll();
	$catalogdata = CHtml::listData($catalogmodel,'cid','cataname');
	
	$speechmodel = Speech::model()->findAll();
	$speechdata = CHtml::listData($speechmodel,'sid','abbreviation');

	Yii::app()->clientScript->registerScript('rule', "
	$('.rule-button').click(function(){
		$('#rule_dialog').dialog('open');
		return false;
	});
	");
?>


<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'word-form',
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>
	<p class="note"><?php echo CHtml::link('Phonetic input rule','#',array('class'=>'rule-button')); ?></p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'spell'); ?>
		<?php echo $form->textField($model,'spell',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'spell'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'phonetic'); ?>
		<?php echo $form->textField($model,'phonetic',array('size'=>20,'maxlength'=>20)); ?>
		<?php echo $form->error($model,'phonetic'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sid'); ?>
		<?php echo $form->dropDownList($model,'sid',$speechdata); ?>
		<?php echo $form->error($model,'sid'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'chinese'); ?>
		<?php echo $form->textField($model,'chinese',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'chinese'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'cid'); ?>
		<?php echo $form->dropDownList($model,'cid',$catalogdata); ?>
		<?php echo $form->error($model,'cid'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sentence'); ?>
		<?php echo $form->textArea($model,'sentence',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'sentence'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sound'); ?>
		<?php echo $form->textField($model,'sound',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'sound'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'slow_sound'); ?>
		<?php echo $form->textField($model,'slow_sound',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'slow_sound'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'sentence_sound'); ?>
		<?php echo $form->textField($model,'sentence_sound',array('size'=>60,'maxlength'=>200)); ?>
		<?php echo $form->error($model,'sentence_sound'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<?
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
    'id'=>'rule_dialog',
    // additional javascript options for the dialog plugin
    'options'=>array(
        'title'=>'Phonetic input rule',
        'autoOpen'=>false,
    ),
));
?>
<table border="1"  border-collapse="true">
<tbody>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">&aelig;</span></td>
<td>-></td>
<td style="border-right:solid 1px;">0</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">&eth;</span></td>
<td>-></td>
<td>1</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ŋ</span></td>
<td>-></td>
<td style="border-right:solid 1px;">2</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ɑ</span></td>
<td>-></td>
<td>3</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ɒ</span></td>
<td>-></td>
<td style="border-right:solid 1px;">4</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ɔ</span></td>
<td>-></td>
<td>5</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ə</span></td>
<td>-></td>
<td style="border-right:solid 1px;">6</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ɛ</span></td>
<td>-></td>
<td>7</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ɜ</span></td>
<td>-></td>
<td style="border-right:solid 1px;">8</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ɡ</span></td>
<td>-></td>
<td>9</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ɪ</span></td>
<td>-></td>
<td style="border-right:solid 1px;">A</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ʃ</span></td>
<td>-></td>
<td>B</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ʊ</span></td>
<td>-></td>
<td style="border-right:solid 1px;">C</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ʌ</span></td>
<td>-></td>
<td>D</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ʒ</span></td>
<td>-></td>
<td style="border-right:solid 1px;">E</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ˈ</span></td>
<td>-></td>
<td>F</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ˌ</span></td>
<td>-></td>
<td style="border-right:solid 1px;">G</td>
<td style="text-align:right"><span style="font-family: Lucida Sans Unicode;" lang="EN-US">ː</span></td>
<td>-></td>
<td>H</td>
</tr>
<tr>
<td><span style="font-family: Lucida Sans Unicode;" lang="EN-US">&theta;</span></td>
<td>-></td>
<td style="border-right:solid 1px;">I</td>
</tr>
</tbody>
</table>



<?
$this->endWidget('zii.widgets.jui.CJuiDialog');
?>